import java.util.ArrayList;

/**
 * @author: zh
 * @date: 2021/12/17 23:59
 * @version: 1.0
 */
public class Zh0202Department extends Zh0202Enterprise {
    private ArrayList<Zh0202Enterprise> employees = new ArrayList<>();
    public Zh0202Department(String name) {
        super(name);
    }

    @Override
    public void sendMsg(String to, String msg) {
        //
    }

    /**
     * +   addEmployee(Zh0202Enterprise e)
     * +   delEmployee(Zh0202Enterprise e)
     * +   receiveMsg(String to,String msg) : void
     * +   response() : void
     */
    public void addEmployee(Zh0202Enterprise enterprise){
        employees.add(enterprise);
    }
    public void delEmployee(Zh0202Enterprise enterprise){
        employees.remove(enterprise);
    }

    @Override
    public void receiveMsg(String from, String msg) {
        for (Zh0202Enterprise employee : employees) {
            System.out.println(employee.name + "接收来自" + from + "的会议通知,内容是:" + msg);
        }
    }
}
